home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
dev
/
gg
/
gengetopt-2.6.lha
/
gengetopt-2.6
/
src
/
strdup.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-12-17
|
272b
|
18 lines
/* strdup.c replacement of strdup, which is not standard */
#include <stdlib.h>
#include <string.h>
char *
strdup (const char *s)
{
char *result = (char*)malloc(strlen(s) + 1);
if (result == (char*)0)
return (char*)0;
strcpy(result, s);
return result;
}